package com.quickask.dao;

import com.quickask.common.Pager;
import com.quickask.entity.AsknowQuestionClassifyEntity;
import com.quickask.idao.IQuestionClassifyDao;

/**
 * Created by Administrator on 2015/9/30.
 */
public class QuestionClassifyDao extends BaseDao<AsknowQuestionClassifyEntity, Integer> implements IQuestionClassifyDao {
    /**
     * 添加问题类别实体
     *
     * @param asknowQuestionClassifyEntity
     */
    @Override
    public void addQuestionClassify(AsknowQuestionClassifyEntity asknowQuestionClassifyEntity) {
        save(asknowQuestionClassifyEntity);
    }

    /**
     * 更具问题类别获取问题分页
     * @param pageNo 分页号
     * @param pageSize 分页大小
     * @param classifyName 类别名
     * @return
     */
    @Override
    public Pager<AsknowQuestionClassifyEntity> findQuestionPagerByQuestionClassify(int pageNo, int pageSize, String classifyName) {
        return findPagerByFetchedHql("from AsknowQuestionClassifyEntity as aqce where aqce.questionTag=? order by aqce.classifyId desc", null, pageNo, pageSize, classifyName);
    }
}
